package ae.pcfc.etks.online.common.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AppMetaData entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_APP_META_DATA", schema = "ETKS_ONLINE_DBA")
public class AppMetaData implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields

	private String applicationId;
	private String wfIncidentId;
	private String wfInitiatedBy;
	private String wfStatus;
	private String applicationDate;	
	private Process Process;
	private String clientRefNo;
	private Long clientId;
	private Long userId;
	private String wfStatusEn;
	private String wfStatusAr;
	private String applicationLink;
	private Set<ProcStepActions> ProcStepActionses = new HashSet<ProcStepActions>(
			0);
	private Set<ProcStepAthmnt> ProcStepAthmnts = new HashSet<ProcStepAthmnt>(
			0);
	private Set<ProcStepsComnts> ProcStepsComntses = new HashSet<ProcStepsComnts>(
			0);
	
	// Constructors

	/** default constructor */
	public AppMetaData() {
	}

	/** minimal constructor */
	public AppMetaData(String wfIncidentId, String wfInitiatedBy,
			String applicationDate) {
		this.wfIncidentId = wfIncidentId;
		this.wfInitiatedBy = wfInitiatedBy;
		this.applicationDate = applicationDate;
	}

	/** full constructor */
	public AppMetaData(String wfIncidentId,
			String wfInitiatedBy, String wfStatus, String wfStatusEn, String wfStatusAr, String applicationDate) {		
		this.wfIncidentId = wfIncidentId;
		this.wfInitiatedBy = wfInitiatedBy;
		this.wfStatus = wfStatus;
		this.wfStatusEn = wfStatusEn;
		this.wfStatusAr = wfStatusAr;		
		this.applicationDate = applicationDate;	
	}

	// Property accessors
	@Id
	@Column(name = "APPLICATION_ID", nullable = false, length = 2000 )
	public String getApplicationId() {
		return this.applicationId;
	}

	public void setApplicationId(String applicationId) {
		this.applicationId = applicationId;
	}
	
	@Column(name = "WF_INCIDENT_ID", nullable = false, length = 50)
	public String getWfIncidentId() {
		return this.wfIncidentId;
	}

	public void setWfIncidentId(String wfIncidentId) {
		this.wfIncidentId = wfIncidentId;
	}
	
	@Column(name = "WF_INITIATED_BY", nullable = false, length = 50)
	public String getWfInitiatedBy() {
		return this.wfInitiatedBy;
	}

	public void setWfInitiatedBy(String wfInitiatedBy) {
		this.wfInitiatedBy = wfInitiatedBy;
	}

	@Column(name = "WF_STATUS", length = 50)
	public String getWfStatus() {
		return this.wfStatus;
	}

	public void setWfStatus(String wfStatus) {
		this.wfStatus = wfStatus;
	}

	@Column(name = "APPLICATION_DATE", nullable = false, length = 50)
	public String getApplicationDate() {
		return this.applicationDate;
	}

	public void setApplicationDate(String applicationDate) {
		this.applicationDate = applicationDate;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROCESS_CODE")
	public Process getProcess() {
		return this.Process;
	}

	public void setProcess(Process Process) {
		this.Process = Process;
	}

	@Column(name = "CLIENT_REF_NO", nullable = false, length = 50)
	public String getClientRefNo() {
		return clientRefNo;
	}

	public void setClientRefNo(String clientRefNo) {
		this.clientRefNo = clientRefNo;
	}
	
	
	@Column(name = "CLIENT_ID", precision = 11, scale = 0)
	public Long getClientId() {
		return clientId;
	}

	public void setClientId(Long clientId) {
		this.clientId = clientId;
	}
	
	@Column(name = "USER_ID", precision = 11, scale = 0)
	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "appMetaData", orphanRemoval=true )
	public Set<ProcStepActions> getProcStepActionses() {
		return this.ProcStepActionses;
	}

	public void setProcStepActionses(
			Set<ProcStepActions> ProcStepActionses) {
		this.ProcStepActionses = ProcStepActionses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "appMetaData")
	public Set<ProcStepAthmnt> getProcStepAthmnts() {
		return this.ProcStepAthmnts;
	}

	public void setProcStepAthmnts(
			Set<ProcStepAthmnt> ProcStepAthmnts) {
		this.ProcStepAthmnts = ProcStepAthmnts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "appMetaData", orphanRemoval=true)
	public Set<ProcStepsComnts> getProcStepsComntses() {
		return this.ProcStepsComntses;
	}

	public void setProcStepsComntses(
			Set<ProcStepsComnts> ProcStepsComntses) {
		this.ProcStepsComntses = ProcStepsComntses;
	}

	@Column(name = "APPLICATION_LINK", length = 600)
	public String getApplicationLink() {
		return applicationLink;
	}

	public void setApplicationLink(String applicationLink) {
		this.applicationLink = applicationLink;
	}
	
	@Column(name = "WF_STATUS_EN", length = 250)
	public String getWfStatusEn() {
		return wfStatusEn;
	}

	public void setWfStatusEn(String wfStatusEn) {
		this.wfStatusEn = wfStatusEn;
	}

	@Column(name = "WF_STATUS_AR", length = 250)
	public String getWfStatusAr() {
		return wfStatusAr;
	}

	public void setWfStatusAr(String wfStatusAr) {
		this.wfStatusAr = wfStatusAr;
	}


	
}